﻿using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.ComponentModel;
using WPFExcelReport.Helpers;
namespace WPFExcelReport
{
    public partial class TKUNDADR
    {
        #region ==KD15KEY===========
        public static readonly DependencyProperty KD15KEYProperty = DependencyProperty.Register("KD15KEY",
            typeof(string), typeof(TKUNDADR),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnKD15KEYChanged));
        public string KD15KEY
        {
            get
            {
                return (string)GetValue(KD15KEYProperty);
            }
            set
            {
                SetValue(KD15KEYProperty, value);
                OnKD15KEYChg(value);
            }
        }
        private static void OnKD15KEYChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as TKUNDADR;
            if (src != null)
            {
                src.KD15KEY = (string)e.NewValue;
            }
        }
        #endregion
        public TKUNDADR()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VKUNDADR();
            this.DataContext = MV;
            InitializeComponent();
        }
        public void OnKD15KEYChg(string value)
        {
            /*
            if (value.Trim().EndsWith("VK"))
            {
                cVK.Focus();
                return;
            } 
            if (value.Trim().EndsWith("VV"))
            {
                cVV.Focus();
                return;
            }
            if (value.Trim().EndsWith("VR"))
            {
                cVR.Focus();
                return;
            }
            cTH.Focus();
            */
        }
    }
}
